home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / misc / x10-amh-.000 / x10-amh- / x10-amh-v1.04 / x10-amh.h < prev    next >
C/C++ Source or Header  |  1996-02-13  |  3KB  |  88 lines

  1. // Program     : x10-amh
  2. // Version     : 1.04
  3. // Description : X10 Model CP-290 control program (available at Radio Shack)
  4. //               (computer control for X10 modules)
  5. //               This application allows you to control lights and appliances
  6. //               in your home either directly, or through a crontab
  7. // Author      : Copyright (C) 1995 Aaron Hightower (aaron@paradigmsim.com)
  8. //               1217 Shirley Way
  9. //               Bedford, TX  76022 (817)267-6001
  10. //
  11. //  This program is free software; you can redistribute it and/or modify
  12. //  it under the terms of the GNU General Public License as published by
  13. //  the Free Software Foundation; either version 2 of the License, or
  14. //  (at your option) any later version.
  15. //
  16. //  This program is distributed in the hope that it will be useful,
  17. //  but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. //  GNU General Public License for more details.
  20. //
  21. //  You should have received a copy of the GNU General Public License
  22. //  along with this program; if not, write to the Free Software
  23. //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  
  25. typedef struct {
  26.  
  27.   unsigned char id;
  28.   unsigned char ev_num[2];
  29.   unsigned char mode;
  30.   unsigned char daymap;
  31.   unsigned char hour;
  32.   unsigned char minute;
  33.   unsigned char devbm[2];
  34.   unsigned char housecode;
  35.   unsigned char lev_fun;
  36.   unsigned char checksum;
  37.  
  38. } event;
  39.  
  40. class x10 {
  41.  
  42.   private:
  43.  
  44.     unsigned char events[128][8];
  45.  
  46.     int listvalid;
  47.     int verbose;
  48.     int hc_char;
  49.     int hc;
  50.     int fd;
  51.  
  52.   public:
  53.  
  54.      x10( int _fd );
  55.     ~x10();
  56.  
  57.   private:
  58.  
  59.   public:
  60.  
  61.     int    wack           ( );
  62.     int    wreport        ( );
  63.     void   dump           ( );
  64.     void   send_housecode ( );
  65.     void   config_serial  ( );
  66.     void   selftest       ( );
  67.     void   settime        ( );
  68.     void   gettime        ( );
  69.     void   readtab        ( );
  70.     void   listtab        ( );
  71.     void   verbose_on     ( );
  72.     void   emptytab       ( );
  73.     void   writetab       ( int empty = 0 );
  74.     void   readtab        ( const char *filename );
  75.     void   printevent     ( int i );
  76.     void   setEvent       ( int i, char housecode,
  77.                             const char *devmap, const char *daymap,
  78.                             int mode, int minute, int hour, int dimlevel,
  79.                             int func );
  80.  
  81.     void   msg            ( u_char *msg, int len      );
  82.     u_char checksum       ( u_char *bytes, int len    );
  83.     void   direct         ( u_char command, char *str );
  84.     void   setFD          ( int _fd                   );
  85.     void   housecode      ( int _hc                   );
  86.  
  87. };
  88.